from django import template
from django.utils.safestring import mark_safe

register = template.Library()


@register.simple_tag
def tag_tabrowfakelist():
# def tag_tabrowfakelist(myiter, ref=False):
    myiter = [1,2,7,8,9]
    ref = True
    temp = '<table>\n'
    tempstr = '<tr><td><a href="#{0}">{0}</a></td></tr>\n' if ref else '<tr><td>{0}</td></tr>\n'
    for x in myiter:
        temp += tempstr.format(x)
    temp += '</table>\n'
    return mark_safe(temp)